﻿using ECommerce.ProductService.Entities;
using System.ComponentModel.DataAnnotations;

namespace ProductService.Entities
{
    public class Category
    {
        public Guid Id { get; set; }

        [Required]
        [MaxLength(50)]
        public string Name { get; set; } = string.Empty;

        [MaxLength(200)]
        public string Description { get; set; } = string.Empty;

        // 导航属性：一对多关系，一个分类包含多个产品
        public ICollection<Product> Products { get; set; } = new List<Product>();
        public DateTime CreatedAt { get; set; }

        public DateTime UpdatedAt { get; set; }
    }

}
